<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>账户提现</title>
		<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<script src="../js/jquery.min.js"></script>
		<script src="../js/layer/layer.js"></script>
		<style type="text/css">
			*{
				margin: 0rem;
				padding: 0rem;
				text-decoration: none;
				list-style: none;
				
			}
			html,body{
				background-color: #fff;
				width: 100%;
				height: 100%;
				 /*font-size:  100rem;*/
				 font-size: calc(100vw / 7.5);
				 font-family: "microsoft yahei";
			}
		
			/*内容*/
			.content{
				box-sizing: border-box;
				padding-left: 0.32rem;
				width: 100%;
				position: relative;
				min-height: 10.8rem;
			}
			.content{
				width: 100%;
			}
			.content form {
				width: 100%;
			}
			.content form .info{
				box-sizing: border-box;
				height: 1rem;
				line-height: 1rem;
				width: 100%;
				font-size: 0.28rem;
				color: #9db2c3;
				border-color: #fff;
				padding: 0rem;
				border-bottom: 1px solid #e9f0f0;
			}
			
			.sub{
				/*position: absolute;*/
				/*bottom: 0.8rem;*/
				/*left: 0.64rem;*/
				margin-left: 0.78rem;
				width: 6.25rem;
				height: 0.9rem;
				background: #7f9eba !important;
				color: #fff !important;
			}
			.content form .button-wrapper{
				width: 100%;
			}
			.content form .button-wrapper li{
				margin-bottom: 0.25rem;
			}
			.content form .button-wrapper li button{
				text-align: center;
				line-height:0.59rem;
				padding: 0rem;
				margin-right: 0.25rem;
				width: 1.92rem;
				height: 0.59rem;
			}
			.content form .button-wrapper li .active{
				background: #819fba;
				color: #fff;
			}
			.content form .radio-box p{
				color: #3f5468;
				font-size: 0.33rem ;
				margin-top: 0.8rem;
			}
			.content form .radio-box li{
				position: relative;
				width: 100%;
				height: 1.09rem;
				line-height: 1.09rem;
			}
			.content form .radio-box li img{
				width: 0.56rem;
				height: 0.56rem;
			}
			.content form .radio-box li .info-box{
				display: inline-block;
				height: 1.09rem;
				line-height: 1.09rem;
				vertical-align: middle;
			}

			.content form .radio-box li label{
				font-size: 0.28rem;
				display: inline-block;
				height: 1.09rem;
				width: 5.44rem;
				color: #6e6e6e;
				vertical-align: top;
			}
			.content form .radio-box li input{
				
				position: absolute;
				right: 0.32rem;
				top: 0.55rem;
				width: 0.31rem;
				height: 0.3rem;
			}
			.content form .middle{
				position:relative;
				padding-right: 0.32rem;
				width: 100%;
				margin-top: -0.3rem;
				height: 0.6rem;
				font-size: 0.26rem;
				text-align: right;
			}
			.content form .middle span{
				box-sizing: border-box;
				height: 1rem;
				line-height: 1rem;
				width: 100%;
				color: #9db2c3;
				border-color: #fff;
				padding: 0rem;
			}
			.content form .middle .info{
				
				border: 0;
				
			}
			.content form .middle a{
				position:absolute;
				left:0rem;
				top: 0.25rem;
			}
			.content form .middle .tixian{
				color: #0092ee;
			}
			/* 修改小圆点 */
			.info-box {
				position: relative;
			}

			.info-box label {
				position: relative;
			}

			.info-box label input {
				position: absolute;
				/* left: -9999px; */
				opacity: 0;
			}

			.info-box label i {
				display: block;
				position: absolute;
				top: 0.45rem;
				right: -0.5rem;
				width: 15px;
				height: 15px;
				outline: 0;
				border: 0.01rem solid #9a9a9a;
				background: #fff;
				border-radius: 50%;
				transition: border-color .3s;
				-webkit-transition: border-color .3s;
			}

			.info-box label input + i:after {
				position: absolute;
				content: '';
				top: 50%;
				left: 50%;
				margin-top: -2.5px;
				margin-left: -2.5px;
				width: 5px;
				height: 5px;
				border-radius: 50%;
				background-color: #fff;
				opacity: 0;
				transition: opacity .1s;
				-webkit-transition: opacity .1s;
			}

			.info-box label input:checked + i:after {
				opacity: 1;
				background: #fff;
			}
			.info-box label input:checked + i{
				background: #9a9a9a;
			}
		</style>
	</head>

	<body>
		<script>
			$(function(){
				$("#wrapper").load("../header.html")
				
			})
			setTimeout(function(){
				$("#wrapper").find(".con").html("账户提现").end().find(".dot img").css("display","none");
				$(".arrow").on("tap",function(){
				window.location.href = "zhanghuzhongxin.html";
			})
			},200)
			setTimeout(function(){
				$("#wrapper").find(".con").html("账户提现").end().find(".dot img").css("display","none");
				$(".arrow").on("tap",function(){
				window.location.href = "zhanghuzhongxin.html";
			})
			},2000)
		</script>
		
		<div class="wrapper" id="wrapper"></div>
		
		
		<div class="content">
			<form action="#" method="post">
				<input type="text" name="nicheng" class="info" id="tixian" value="" placeholder="请输入提现金额"/>
				<input type="text" id="hid" style="display: none;" placeholder="form下只有一个表单回车会触发刷新"/>
				<!-- <ul class="button-wrapper">
					<li>
						<button type="button" class="mui-btn mui-btn-white">50元</button>
						<button type="button" class="mui-btn mui-btn-white active">100元</button>
						<button type="button" class="mui-btn mui-btn-white">200元</button>
					</li>
					<li>
						<button type="button" class="mui-btn mui-btn-white">500元</button>
						<button type="button" class="mui-btn mui-btn-white">1000元</button>
						<button type="button" class="mui-btn mui-btn-white">2000元</button>
					</li>
				</ul> -->
				
				<div class="middle">
					<a href="#">24小时之内到账</a>
					<span>余额</span>
					<span class="info"></span>
					<span class="tixian">全部提现</span>
				</div>
				<ul class="radio-box">
					<p>提现到</p>
					<!--<li>
						<img src="../img/icon-weixin.png" alt="">
						<div class = "info-box">
							<label for="">微信支付<input type="radio" class="input" name="pay" id="1" value="" checked="checked"/><i></i></label>
						</div>
					</li>-->
					<li>
						<img src="../img/icon-zhifubao.png" alt="">
						<div class = "info-box">
							<label for="">支付宝支付<input type="radio" class="input" name="pay" id="2" value="" /><i></i></label>
						</div>
					</li>
					<li>
						<img src="../img/icon-yinlian.png" alt="">
						<div class = "info-box">
							<label for="">银行卡支付<input type="radio" class="input" name="pay" id="3" value="" /><i></i></label>
						</div>
					</li>
				</ul>
				
				

			</form>
		</div>
		<input type="button" class="sub" value = "确认提现" id="confirm" onclick="confirm_click()">
		<script src="../js/mui.min.js"></script>
		<script>

            //	监听键盘 前往 事件
            $("#tixian").keydown(function (e) {
                console.log(e);
                console.log(e.keyCode);
                if (e.keyCode === 13)
                {
                    $("#confirm").trigger('click');
                    $("#pay_number").blur();
                }
            });

			$(".middle .info").html(localStorage.cash_money)
			$(".tixian").on("tap",function(){
				var num = parseFloat($(".middle").find(".info").html());
				$("#tixian").val(num);
				// console.log($("#tixian").val())
			})

            function confirm_click(){
                var wd_num = $("#tixian").val();
                var pay_manner = $(".input:checked").attr("id");
                console.log(pay_manner);
                console.log(wd_num)
                if(wd_num && pay_manner){
                    $.ajax({
                        type: "POST",
                        url: `${localStorage.top}api/index/withdraw`,
                        data: {
                            "TOKEN":`${localStorage.token}`,
                            "wd_num": `${wd_num}`,
                            "pay_manner": `${pay_manner}`
                        },
                        success: function(data){
                            if(data.code == localStorage.erro){
                                layer.msg(data.msg)
                            }else{
                                layer.msg(data.msg)
                                localStorage.cash_money = data.data.cash_money;
                                setTimeout(function(){
                                    $(".arrow").trigger("tap")
                                },500)
                            }


                            console.log(data)
                        }
                    })
                }else{
                    layer.msg("请输入金额")
                }
            }


			// console.log(localStorage.cash_money)
		</script>
	</body>

</html>